#include "b.h"
#include "stdio.h"
#include "stdlib.h"

 int search(char list[],char c,int len);  
int kh_erfen()
{
   char list[7]={'a','b','c','d','e','f','g'};
   
   printf("%d" ,search(list,'d',7));
   return 0;
   
}

int search(char list[],char c,int len)
{
  int low=0;
  int high=len-1;
  int k;
  while(low<=high)
  {
     k=(low+high)/2 ;
     if(c==list[k])
       return k;
     if  (c<list[k])
               high=k-1;
      if (c>list[k])
           low=k+1;
           
                   
  }
  return -1;
}

